<!DOCTYPE html>
<html lang="en">

	<head>
		<!-- BEGIN META -->
		<?php $this->load->view('Public/headmeta.html');?>
		<!-- END META -->

		<!-- BEGIN STYLESHEET-->
		<?php $this->load->view('Public/headcss.html');?>
		<!-- END STYLESHEET-->
		<title>
			<?php echo $current['title']."-".$setting['title'];?>
		</title>

	</head>

	<body>
		<!-- BEGIN SECTION -->
		<section id="container">
			<!-- BEGIN HEADER -->
			<?php $this->load->view('Public/header.html');?>
			<!-- END HEADER -->
			<!-- BEGIN SIDEBAR -->
			<?php $this->load->view('Public/sidebar.html');?>
			<!-- END SIDEBAR -->
			<!-- BEGIN MAIN CONTENT -->
			<section id="main-content">
				<!-- BEGIN WRAPPER  -->
				<section class="wrapper">
					<!-- TOPMENU ROW  -->
					<?php $this->load->view('Public/topmenu.html');?>
					<!-- TOPMENU ROW  -->

					<!-- BEGIN ROW  -->
					<div class="row">
						<div class="col-lg-12">
							<section class="panel-bg">
								<header class="panel-heading">
									<span class="label label-primary"><?php echo $current['title'];?></span>
								</header>
								<div class="panel-body">
									<div class="form">
										<form class="cmxform form-horizontal tasi-form" id="authgroupeditForm" method="post" action="<?php echo site_url('Pkadmin/Authgroup/update');?>">
											<div class="form-group">
												<label for="title" class="control-label col-sm-2">角色名称</label>
												<div class="col-sm-3">
													<input class="form-control bg-white" id="title" name="title" type="text" value="<?php echo $auth_group['title'];?>">
												</div>
											</div>

											<div class="form-group">
												<label for="status" class="control-label col-sm-2">角色状态</label>
												<div class="m-bot15">
													<div class="col-sm-3">
														<input class="form-control" id="status" <?php if($auth_group['status'] == 1){echo 'checked="checked"';};?> name="status" type="checkbox" data-toggle="switch">
													</div>
												</div>
											</div>

											<div class="form-group">
												<label for="note" class="control-label col-sm-2">角色描述</label>
												<div class="col-sm-3">
													<textarea class="form-control" id="note" name="note" rows="3"><?php echo $auth_group['note'];?></textarea>
												</div>
											</div>

											<div class="form-group">
												<label for="auth" class="control-label col-sm-2">权限选择</label>
												<div class="col-sm-9">
													<div class="col-sm-10">
														<div class="row">
															<?php foreach($auth_rule_tree as $itemfather):?>
															<div class="panel panel-success">
																<div class="panel-heading form-inline">
																	<label>
																		<input name="rules[]" class="ace ace-checkbox-2 father" <?php if(in_array($itemfather['id'],$auth_group['rules'])){echo 'checked="checked"';};?> type="checkbox" value="<?php echo $itemfather['id'];?>"/>
																		<span class="lbl"> <?php echo $itemfather['title'];?> </span>
																	</label>
																	<span class="tools pull-right">
																		<a href="javascript:;" class="fa fa-chevron-down"></a>
																	</span>
																</div>
																<?php if(!empty($itemfather['children'])):?>
																<div class="panel-body panel-border">
																	<?php foreach($itemfather['children'] as $itemson):?>
																	<label class="col-xs-2 w-160">
																		<input name="rules[]" class="ace ace-checkbox-2 children" <?php if(in_array($itemson['id'],$auth_group['rules'])){echo 'checked="checked"';};?> type="checkbox" value="<?php echo $itemson['id'];?>"/>
																		<span class="lbl"> <?php echo $itemson['title'];?> </span>
																	</label>
																	<?php if(!empty($itemson['children'])) foreach($itemson['children'] as $item):?>
																	<label class="col-xs-2 w-160">
																		<input name="rules[]" class="ace ace-checkbox-2 children" <?php if(in_array($item['id'],$auth_group['rules'])){echo 'checked="checked"';};?> type="checkbox" value="<?php echo $item['id'];?>"/>
																		<span class="lbl"> <?php echo $item['title'];?> </span>
																	</label>
																	<?php endforeach;?>
																	<?php endforeach;?>
																</div>
																<?php endif;?>
															</div>
															<?php endforeach;?>
														</div>

													</div>

												</div>
											</div>

											<div class="form-group">
												<input type="hidden" name="id" id="id" value="<?php echo $auth_group['id'];?>">
												<div class="col-sm-offset-2 col-sm-10">
													<button class="btn btn-primary" type="submit">保存</button>
													<button class="btn btn-default" type="reset">重置</button>
												</div>
											</div>
										</form>
									</div>
								</div>
							</section>
						</div>
					</div>
					<!-- END ROW  -->
				</section>
				<!-- END WRAPPER  -->
			</section>
			<!-- END MAIN CONTENT -->
			<!-- BEGIN FOOTER -->
			<?php $this->load->view('Public/footer.html');?>
			<!-- END FOOTER -->
		</section>
		<!-- END SECTION -->
		<!-- BEGIN JS -->
		<?php $this->load->view('Public/footjs.html');?>
		<script src="<?php echo base_url('Public/js/pkadmin/authgroup.js');?>"></script>
		<!-- PKADMIN AUTHGROUP JS -->
		<!-- END JS -->
	</body>

</html>